Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Layer 2 scan using wpa_supplicant cli #1337

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

maxliu2001
Copy link

This is the continuation of the layer 2 pscheduler-tool-bssidscanner tool developed over the last summer. I have implemented the scan via wpa_supplicant cli. I would start by checking if the wpa supplicant interface has already been initiated. If not, the script would write a config file that us used to initiate the wpa supplicant interface.
Screen Shot 2023-05-24 at 3 06 12 PM
After the initialization of the interface, we would expect the wpa supplicant to run in the background. The program would then invoke wpa_cli scan and wpa_cli scan_result in order to retrieve the scan data. wpa_cli scans for the results intermittently in the background and stores the restore in its cache. During the scanning state, it would not return any results for the output. My program would detect such state and keep calling the cli to retrieve result. However, significant runtime improvement can be observed when the cli is not actively scanning for bssid.
Screen Shot 2023-05-24 at 3 11 16 PM
Ed has specified that it is desirable to leave ssid as an option. In my program, bssid corresponding to a specific ssid will be filtered. If ssid is not specified, all available entry points would be scanned. I also have to change cli_to_spec and result_format within the pscheduler-test-wifibssid package in order to change the command line validation and to load the result from the scan result I'm able to gather.
Screen Shot 2023-05-24 at 3 14 28 PM
One wrinkle I noticed is that the active scanning phase of the cli can be found by runningwpa_cli scan_result with a part of the result as FAIL_BUSY after the initial run. My while loop deals with both situations.

@mfeit-internet2
Copy link
Member

mfeit-internet2 commented Jun 2, 2023

Actions from review:

  • Get rid wrapped script, adjust Makefile accordingly
  • Adjust the time estimates from duration to reflect extra time taken by run in loops, etc.
  • Bulletproof process return values (die appropriately if return code is non-zero)
  • Incorporate sudo bits into RPM and Debian packaging

Packaging examples:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants